package com.coc.proxy;

import static org.junit.Assert.*;

import org.junit.Test;

public class TestProxy {

	@Test
	public void test() throws ClassNotFoundException, InstantiationException, IllegalAccessException {
//		Sourceable source = new Proxy();
//		source.method();
		
//		Sourceable source1 = new Proxy(new Source2());
//		source1.method();
		
		Sourceable source2 = new Proxy(new Source3(),1);
		source2.method();
	}

}

class Source2 implements Sourceable{
	@Override
	public void method() {
		System.out.println("Source2........222222");
	}
}

class Source3 implements Sourceable{
	@Override
	public void method() {
		System.out.println("Source3........3333333333");
	}
}